﻿@using PlatformNetCore.Entity
@{
    ViewBag.Title = "新增广告位";
}
@model AdSlot
<style>
    html {
        background-color: #fff;
    }

    .layui-card {
        box-shadow: none;
    }
</style>

<div class="layui-card">
    <div class="layui-card-body">
        <form class="layui-form" action="@Url.Action("AdSlotAdd","Ad",new { area = "Admin"})" lay-filter="useradd-form">
            <div class="layui-form-item">
                <label class="layui-form-label">标题*</label>
                <div class="layui-input-block">
                    <input type="text" name="Title" lay-verify="required" placeholder="标题" autocomplete="on" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">广告位代码*</label>
                <div class="layui-input-block">
                    <input type="text" name="AdSlotCode" lay-verify="required" placeholder="广告位代码" autocomplete="on" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">排序号</label>
                <div class="layui-input-block">
                    <input type="text" name="SortNo" value="1000" lay-verify="required" placeholder="排序号" autocomplete="on" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">描述</label>
                <div class="layui-input-block">
                    <textarea type="text" name="Remark" class="layui-textarea" placeholder="描述"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否启用</label>
                <div class="layui-input-block">
                    <input type="checkbox" checked="" name="IsAvailable" value="1" lay-skin="switch" lay-filter="component-form-switchTest" lay-text="启用|禁用">
                </div>
            </div>
            <div id="useradd-submit" lay-submit lay-filter="useradd-submit"></div>
        </form>
    </div>
</div>
<script>
    layui.use(['form'], function () {
        var $ = layui.$, form = layui.form;

        form.render(null, 'useradd-form');

        /* 监听指定开关 */
        form.on('switch(component-form-switchTest)', function (data) {
            $(this).val(this.checked ? '1' : '0')
        });
    });
</script>
